<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<div class="sidebar responsive" id="sidebar">
	<script type="text/javascript">
		try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
	</script>

	<div class="sidebar-shortcuts" id="sidebar-shortcuts">
		<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
			<button class="btn btn-success">
				<i class="icon-signal"></i>
			</button>

			<button class="btn btn-info">
				<i class="icon-pencil"></i>
			</button>

			<button class="btn btn-warning">
				<i class="icon-group"></i>
			</button>

			<button class="btn btn-danger">
				<i class="icon-cogs"></i>
			</button>
		</div>

		<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
			<span class="btn btn-success"></span>

			<span class="btn btn-info"></span>

			<span class="btn btn-warning"></span>

			<span class="btn btn-danger"></span>
		</div>
	</div><!-- #sidebar-shortcuts -->

	<ul class="nav nav-list">
		<c:forEach items="${menus}" var="menu">
			<c:if test="${menu.parentId == 1}">
				<li>
					<a href="#" class="dropdown-toggle">
						<i class="icon-list"></i>
						<span class="menu-text"> ${menu.name}</span>
						<b class="arrow icon-angle-down"></b>
					</a>
					<ul class="submenu">
						<c:forEach items="${menus}" var="subm">
							<c:if test="${menu.id == subm.parentId}">
								<li>
									<a href="${ctx}/manage${menu.url}${subm.url}" onclick="menu('${subm.name}','${ctx}/manage${menu.url}${subm.url}')" target="mainpage">
										<i class="icon-double-angle-right"></i>
										${subm.name}
									</a>
								</li>
							</c:if>
						</c:forEach>
					</ul>
				</li>
			</c:if>
	    </c:forEach>
	  
	</ul><!-- /.nav-list -->

	<div class="sidebar-collapse" id="sidebar-collapse">
		<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
	</div>

	<script src="${ctx}/static/js/layer/layer.js"></script>
	<script src="${ctx}/static/js/tender.js"></script>
	<script type="text/javascript">
		try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
		$(function(){
			$(".submenu li").click(function() {
				$(".submenu li.active").removeClass("active");
				$(this).attr("class", "active");
			});
			
		});
		function menu(name, url) {
			$("#menu").html(name);
			$("#menu").attr("href", url);
			$("#menu").attr("target", "mainpage");
			loading();
			$("#mainpage").load(function() { 
				layer.closeAll('loading'); 
			});
		}
	</script>
	
</div>